﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using EZCRS.HCMS.Entity;
using EZCRS.HCMS.Bll;
using EZCRS.HCMS.Web;
using EZCRS.HCMS.Bll.baseinfo;

namespace EZCRS.HCMS.Web.manage.hotel
{
    public partial class policy : ManageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckModule(56);

            if (base.BasHotelId == 0)
                Response.Write(CFun.AlertMeg(Resources.Site.MustHotel, "back", ""));
            if (!Page.IsPostBack)
            {
                HCRS_Description _des = new BllPolicy().getdescription(base.BasPropertyId);
                if (_des != null)
                {
                    txtagent.Text = _des.agent;
                    txtbooking.Text = _des.booking;
                    txtusual.Text = _des.usual;
                }
            }
        }

        protected void btnsave_Click(object sender, EventArgs e)
        {
            if(new BllPolicy().savepolicyother(base.BasPropertyId,txtbooking.Text,txtusual.Text,txtagent.Text))
                Page.ClientScript.RegisterClientScriptBlock(typeof(String), "scuress", CFun.AlertMeg(Resources.Site.SystemModifySuccess, "", "policy.aspx"));
            else
                Response.Write(CFun.AlertMeg(Resources.Site.SystemError, "back", ""));
        }
    }
}
